package com.lb.shopguide.ui.fragment.boss.market;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.lb.shopguide.R;
import com.lb.shopguide.base.BaseCommonFragment;
import com.lb.shopguide.constants.AppConstant;
import com.lb.shopguide.ui.view.NormalTitleBar;
import com.lb.shopguide.util.pic.ImageLoaderUtils;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.OnClick;

public class FragmentActivityIntroduce extends BaseCommonFragment {
    @BindView(R.id.ntb)
    NormalTitleBar ntb;
    @BindView(R.id.iv_activity_intro)
    ImageView ivBack;
    @BindView(R.id.tv_activity_detail)
    TextView tvActivityDetail;

    private String picUrl;

    public static FragmentActivityIntroduce newInstance(String picUrl) {
        FragmentActivityIntroduce fragmentActivityIntroduce = new FragmentActivityIntroduce();
        Bundle bundle = new Bundle();
        bundle.putString(AppConstant.IMAGE_URL, picUrl);
        fragmentActivityIntroduce.setArguments(bundle);
        return fragmentActivityIntroduce;
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_activity_introduce;
    }

    @Override
    public void initData() {
        Bundle bundle = getArguments();
        if (bundle.containsKey(AppConstant.IMAGE_URL)) {
            picUrl = bundle.getString(AppConstant.IMAGE_URL);
        }
    }

    @Override
    public void initView() {
        ntb.setTitleText("活动介绍");
        ntb.setLeftImageSrc(R.drawable.iv_back);
        ntb.setOnLeftImageListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                pop();
            }
        });

        ImageLoaderUtils.displayBigPhoto(mContext, ivBack, picUrl);
    }

    @Override
    public void finishRefresh() {

    }

    @Override
    public void sessionOutOfDate() {

    }

    @Override
    public void requestError(String error) {

    }

    @Override
    public String getPageTag() {
        return FragmentActivityIntroduce.class.getName();
    }

    @OnClick(R.id.tv_activity_detail)
    void gotoActivityDetail() {
        // TODO: 2018/8/10
    }


}
